package com.amz.bird.controller;

import com.amz.auth.annotation.RolePermission;
import com.amz.bird.log.Log;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class LoginController {

    @GetMapping("/login")
    @Log(title = "登录接口",isConsistenceDB = true)
    @RolePermission(hasAnyRole = {"admin","visiter"})
    public Object getUser(@RequestParam Map requestParam){
        return requestParam.toString();
    }
    @GetMapping("/logOut")
    @Log(title = "登出接口",isConsistenceDB = false)
    @RolePermission(hasAnyRole = {"admin"})
    public Object outUser(@RequestParam Map requestParam){
        return requestParam.toString();
    }
}
